package d1106;

public class Person {
    private String name;

    public Person(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void howToPlay(Sports sports){

    }

    public void howToPlay(Football football) {
        System.out.println(this.name+"在踢足球");
        football.play();

    }

    public void howToPlay(Basketball basketball) {
        System.out.println(this.name+"在打篮球");
        basketball.play();
    }
    public static void main(String[] args) {
        Person p=new Person("可莉");

        Football football=new Football();
        p.howToPlay(football);
        Basketball basketball=new Basketball();
        p.howToPlay(basketball);
    }
}